{extend name="layout:base" /}
{block name="page_style"}
    <link rel="stylesheet" href="{$site_root}/static/plugins/simditor2.3.15/styles/simditor.css" />
{/block}
{block name="page_content"}
<section class="article-details">
    <div class="center">
        <div class="news-tit">
            {$article.title}<?php if($view_mode == 'preview') { echo('【预览】'); } ?>
        </div>
        <div class="news-data">
            <i class="icon icon-time"></i>
            <span>{$article.create_date}</span>
            <span>{$article.create_hour}</span>
            <i class="icon icon-see"></i>
            <span>{$article.view_count}</span>
        </div>
        <div class="content simditor" style="border:0px;">
            <div class="simditor-body">
                {$article.content|raw}
            </div>
        </div>
        <?php if($article['status'] && $article['second_category_applied']): ?>
            <!--专题专栏-项目申报模块才有此按钮-->
            <div class="do">
                <?php if(empty($current_user)): ?>
                    <button class="join join-login">
                        点击申报项目
                    </button>
                <?php elseif(empty($old_apply)): ?>
                    <button class="join">
                        <a href="{:url('apply/create', ['article_id' => $article['id']])}">
                            点击申报项目
                        </a>
                    </button>
                <?php else: ?>
                    <button class="join">
                        <a href="{:url('apply/read', ['id' => $old_apply['id']])}">
                            查看我的申报
                        </a>
                    </button>
                <?php endif; ?>
            </div>
        <?php endif; ?>
    </div>
</section>
{/block}
{block name="page_js"}
<script type="text/javascript">
    let joinPopMsg = {user_name: '', mobile: ''};
    $(document).ready(function(){
        $(".join-login").on('click', function(){
            showPop('login-pop');
            return false;
        });

        $(".join").on('click', function(){
            var $href = $(this).find('a');
            if($href.length){
                $href[0].click();
            }
        });
    });
</script>
{/block}